//index.js
const app = getApp()

Page({
  data: {
    type:'',
    discribe:"",
    phoneNumber:"",
    shuliDiscribe:"",
    text:
      {
        1 :"大展宏图，信用得固，无远弗界，可获成功吉",
        2 :"根基不固，摇摇欲坠，一盛一衰，劳而无功凶",
        3 :"根深蒂固，蒸蒸日上，如意吉祥，百事顺遂吉", 
        4 :"坎坷前途，苦难折磨，非有毅力，难望成功凶", 
        5 :"阴阳和合，生意欣荣，名利双收，后福重重吉", 
        6 :"万宝云集，天降幸运，立志奋发，可成大功吉", 
        7 :"专心经营，和气致祥，排除万难，必获成功吉", 
        8 :"努力发达，贯彻志望，不忘进退，成功可期吉", 
        9 :"虽抱奇才，有才无命，独营无力，财利无望凶", 
        10:"乌云遮月，暗淡无光，空费心力，徒劳无功凶", 
        11:"草木逢春，枯叶沾露，稳健着实，必得人望吉", 
        12:"薄弱无力，孤立无摇，外祥内苦，谋事难成凶", 
        13:"天赋吉运，能得人望，善用智慧，必获成功吉", 
        14:"忍得苦难，必有后福，是成是败，惟靠坚毅凶", 
        15:"谦恭做事，必得人和，大事成就，一定兴隆吉", 
        16:"能获众望，成就大业，名利双收，盟主四方吉", 
        17:"排除万难，有贵人助，把握时机，可得成功吉",
        18:"经商做事，顺利昌隆，如能慎始，百事亨通吉", 
        19:"成功虽早，慎防空亏，内外不合，障碍重重凶", 
        20:"智高志大，历尽艰难，焦心忧劳，进退两难凶",
        21:"专心经营，善用智慧，霜雪梅花，春来怒放吉", 
        22:"秋草逢霜，怀才不遇，忧愁怨苦，事不如意凶", 
        23:"旭日升天，名显四方，渐次进展，终成大业吉", 
        24:"锦绣前程，须靠自力，多用智谋，能奏大功吉", 
        25:"天时地利，再得人格，讲信修睦，即可成功吉", 
        26:"波澜起伏，千变万化，凌驾万难，必可成功凶",
        27:"一成一败，一盛一衰，惟靠谨慎，可守成功凶带吉", 
        28:"鱼临旱地，难逃恶运，此数大凶，不如更名凶", 
        29:"如龙得云，青云直上，智谋奋进，才略奏功吉", 
        30:"吉凶参半，得失相伴，投机取巧，如赛一样凶", 
        31:"此数大吉，名利双收，渐进向上，大业成就吉", 
        32:"池中之龙，风云际会，一跃上天，成功可望吉", 
        33:"不可意气，善用智慧，如能慎始，必可昌隆吉", 
        34:"灾难不绝，难望成功，此数大凶，不如更名凶", 
        35:"中吉之数，进退保守，生意安稳，成就可期吉", 
        36:"波澜重迭，常陷穷困，动不如静，有才无命凶", 
        37:"逢凶化吉，吉人天相，风条雨顺，生意兴隆吉", 
        38:"名虽可得，利则难获，艺界发展，可望成功凶带吉", 
        39:"云开见月，虽有劳碌，光明坦途，指日可期吉", 
        40:"一胜一衰，浮沉不定，知难而退，自获天佑吉带凶", 
        41:"天赋吉运，德望兼备，继续努力，前途无限吉", 
        42:"事业不专，十九不成，专心进取，可望成功吉带凶", 
        43:"雨夜之花，外祥内苦，忍耐自重，转凶为吉吉带凶", 
        44:"虽用心计，事难遂愿，贪功好进，必招失败凶", 
        45:"杨柳遇春，绿叶发枝，冲破难关，一举成名吉", 
        46:"坎坷不平，艰难重重，若无耐心，难望有成凶", 
        47:"有贵人助，可成大业，虽遇不幸，浮沉不大吉", 
        48:"美化丰实，鹤立鸡群，名利俱全，繁荣富贵吉", 
        49:"遇吉则吉，遇凶则凶，惟靠谨慎，逢凶化吉凶", 
        50:"吉凶互见，一成一败，凶中有吉，吉中有凶吉带凶", 
        51:"一盛一衰，浮沉不常，自重自处，可保平安吉带凶", 
        52:"草木逢春，雨过天晴，渡过难关，即获成功吉", 
        53:"盛衰参半，外祥内苦，先吉后凶，先凶后吉吉带凶", 
        54:"虽倾全力，难望成功，此数大凶，最好改名凶", 
        55:"外观隆昌，内隐祸患，克服难关，开出泰运吉带凶", 
        56:"事与愿违，终难成功，欲速不达，有始有终凶", 
        57:"努力经营，时来运转，旷野枯草，春来花开吉", 
        58:"半凶半吉，浮沉多端，始凶终吉，能保成功凶带吉", 
        59:"遇事犹疑，难望成事，大刀阔斧，始可有成凶", 
        60:"黑暗无光，心迷意乱，出尔反尔，难定方针凶",
        61:"云遮半月，百隐风波，应自谨慎，始保平安吉带凶", 
        62:"烦闷懊恼，事事难展，自防灾祸，始免困境凶", 
        63:"万物化育，繁荣之象，专心一意，始能成功吉", 
        64:"见异思迁，十九不成，徒劳无功，不如更名凶", 
        65:"吉运自来，能享盛名，把握机会，必获成功吉", 
        66:"黑夜漫长，进退维谷，内外不合，信用缺乏凶", 
        67:"时来运转，事事如意，功成名就，富贵自来吉", 
        68:"思虑周详，计划力行，不失先机，可望成功吉", 
        69:"动摇不安，常陷逆境，不得时运，难得利润凶", 
        70:"惨淡经营，难免贫困，此数不吉，最好改名凶",
        71:"吉凶参半，惟赖勇气，贯彻力行，始可成功吉带凶", 
        72:"利害混集，凶多吉少，得而复失，难以安顺凶", 
        73:"安乐自来，自然吉祥，力行不懈，终必成功吉",
        74:"利不及费，坐食山空，如无智谋，难望成功凶", 
        75:"吉中带凶，欲速不达，进不如守，可保安详吉带凶", 
        76:"此数大凶，破产之象，宜速改名，以避厄运凶", 
        77:"先苦后甘，先甘后苦，如能守成，不致失败吉带凶", 
        78:"有得有失，华而不实，须防劫财，始保平安吉带凶", 
        79:"如走夜路，前途无光，希望不大，劳而无功凶", 
        80:"得而复失，枉费心机，守成无贪，可保安稳吉带凶", 
        81:"最极之数，还本归元，能得繁业，发达成功吉" 
    },
    shuliText: [
{"name":"太极之数，万物开泰，生发无穷，利禄亨通。","xj":"大吉","value":"太极之数"},
{"name":"两仪之数，混沌未开，进退保守，志望难达。","xj":"大凶","value":"两仪之数"},
{"name":"三才之数，天地人和，大事大业，繁荣昌隆。","xj":"大吉","value":"三才之数"},
{"name":"四象之数，待于生发，万事慎重，不具营谋。","xj":"凶","value":"四象之数"},
{"name":"五行俱权，循环相生，圆通畅达，福祉无穷。","xj":"大吉","value":"五行之数"},
{"name":"六爻之数，发展变化，天赋美德，吉祥安泰。","xj":"半吉","value":"六爻之数"},
{"name":"七政之数，精悍严谨，天赋之力，吉星照耀。","xj":"吉","value":"七政之数"},
{"name":"八卦之数，乾坎艮震，巽离坤兑，无穷无尽。","xj":"吉","value":"八卦之数"},
{"name":"大成之数，蕴涵凶险，或成或败，难以把握。","xj":"凶","value":"大成之数"},
{"name":"终结之数，雪暗飘零，偶或有成，回顾茫然。","xj":"凶","value":"终结之数"},
{"name":"万物更新，调顺发达，恢弘泽世，繁荣富贵。","xj":"大吉","value":"旱苗逢雨"},
{"name":"无理之数，发展薄弱，虽生不足，难酬志向。","xj":"凶","value":"掘井无泉"},
{"name":"才艺多能，智谋奇略，忍柔当事，鸣奏大功。","xj":"大吉","value":"春日牡丹"},
{"name":"家庭缘薄，孤独遭难，谋事不达，悲惨不测。","xj":"凶","value":"破兆"},
{"name":"福寿圆满，富贵荣誉，涵养雅量，德高望重。","xj":"大吉","value":"福寿"},
{"name":"厚德载物，安富尊荣，财官双美，功成名就。","xj":"大吉","value":"厚重"},
{"name":"权威刚强，突破万难，如能容忍，必获成功。","xj":"半吉","value":"刚强"},
{"name":"权威显达，博得名利，且养柔德，功成名就。","xj":"大吉","value":"铁镜重磨"},
{"name":"风云蔽日，辛苦重来，虽有智谋，万事挫折。","xj":"凶","value":"多难"},
{"name":"非业破运，灾难重重，进退维谷，万事难成。","xj":"凶","value":"屋下藏金"},
{"name":"光风霁月，万物确立，官运亨通，大搏名利。女性不宜","xj":"大吉","value":"明月中天"},
{"name":"秋草逢霜，困难疾弱，虽出豪杰，人生波折。","xj":"凶","value":"秋草逢霜"},
{"name":"旭日东升，壮丽壮观，权威旺盛，功名荣达。女性不宜","xj":"大吉","value":"壮丽"},
{"name":"家门余庆，金钱丰盈，白手成家，财源广进。","xj":"大吉","value":"掘藏得金"},
{"name":"资性英敏，才能奇特，涵养性情，可成大业。","xj":"大吉","value":"荣俊"},
{"name":"变怪之谜，英雄豪杰，波澜重叠，而奏大功。","xj":"半吉","value":"变怪"},
{"name":"欲望无止，自我强烈，多受毁谤，尚可成功。","xj":"半吉","value":"增长"},
{"name":"遭难之数，豪杰气概，四海漂泊，终世浮躁。女性不宜","xj":"凶","value":"阔水浮萍"},
{"name":"智谋优秀，财力归集，名闻海内，成就大业。","xj":"半吉","value":"智谋"},
{"name":"沉浮不定，凶吉难变，若明若暗，大成大败。","xj":"半吉","value":"非运"},
{"name":"智勇得志，博得名利，统领众人，繁荣富贵。","xj":"大吉","value":"春日花开"},
{"name":"侥幸多望，贵人得助，财帛如裕，繁荣至上。","xj":"大吉","value":"宝马金鞍"},
{"name":"旭日升天，鸾凤相会，名闻天下，隆昌至极。女性不宜","xj":"大吉","value":"旭日升天"},
{"name":"破家之身，见识短小，辛苦遭逢，灾祸至极。","xj":"凶","value":"破家"},
{"name":"温和平静，智达通畅，文昌技艺，奏功洋洋。","xj":"大吉","value":"高楼望月"},
{"name":"波澜重叠，沉浮万状，侠肝义胆，舍己成仁。","xj":"凶","value":"波澜重叠"},
{"name":"权威显达，热诚忠信，宜着雅量，终身荣富。","xj":"大吉","value":"猛虎出林"},
{"name":"意志薄弱，刻意经营，才识不凡，技艺有成。","xj":"半吉","value":"磨铁成针"},
{"name":"富贵荣华，财帛丰盈，暗藏险象，德泽四方。","xj":"大吉","value":"富贵荣华"},
{"name":"智谋胆力，冒险投机，沉浮不定，退保平安。","xj":"凶","value":"退安"},
{"name":"纯阳独秀，德高望重，和顺畅达，博得名利。此数为最大好","xj":"大吉","value":"有德"},
{"name":"博识多能，精通世情，如能专心，尚可成功。","xj":"凶","value":"寒蝉在柳"},
{"name":"散财破产，诸事不遂，虽有智谋，财来财去。","xj":"凶","value":"散财破产"},
{"name":"破家亡身，暗藏惨淡，事不如意，乱世怪杰。","xj":"凶","value":"烦闷"},
{"name":"新生泰和，顺风扬帆，智谋经纬，富贵繁荣。","xj":"大吉","value":"顺风"},
{"name":"载宝沉舟，浪里淘金，大难尝尽，大功有成。","xj":"凶","value":"浪里淘金"},
{"name":"花开之象，万事如意，祯祥吉庆，天赋幸福。","xj":"大吉","value":"点石成金"},
{"name":"智谋兼备，德量荣达，威望成师，洋洋大观。","xj":"大吉","value":"古松立鹤"},
{"name":"吉临则吉，凶来则凶，转凶为吉，配好三才。","xj":"半吉","value":"转变"},
{"name":"一成一败，吉凶参半，先得庇荫，后遭凄惨。","xj":"凶","value":"小舟入海"},
{"name":"盛衰交加，波澜重叠，如能慎始，必获成功。","xj":"半吉","value":"沉浮"},
{"name":"卓识达眼，先见之明，智谋超群，名利双收。","xj":"大吉","value":"达眼"},
{"name":"外祥内患，外祸内安，先富后贫，先贫后富。","xj":"凶","value":"曲卷难星"},
{"name":"石上栽花，难得有活，忧闷烦来，辛惨不绝。","xj":"凶","value":"石上栽花"},
{"name":"善善得恶，恶恶得善，吉到极限，反生凶险。","xj":"半吉","value":"善恶"},
{"name":"历尽艰辛，四周障碍，万事龃龌，做事难成。","xj":"凶","value":"浪里行舟"},
{"name":"寒雪青松，夜莺吟春，必遭一过，繁荣白事。","xj":"大吉","value":"日照春松"},
{"name":"沉浮多端，先苦后甜，宽宏扬名，富贵繁荣。","xj":"半吉","value":"晚行遇月"},
{"name":"寒蝉悲风，意志衰退，缺乏忍耐，苦难不休。","xj":"凶","value":"寒蝉悲风"},
{"name":"无谋之人，漂泊不定，晦暝暗黑，动摇不安。","xj":"凶","value":"无谋"},
{"name":"牡丹芙蓉，花开富贵，名利双收，定享天赋。","xj":"大吉","value":"牡丹芙蓉"},
{"name":"衰败之象，内外不和，志望难达，灾祸频来。","xj":"凶","value":"衰败"},
{"name":"富贵荣华，身心安泰，雨露惠泽，万事亨通。","xj":"大吉","value":"舟归平海"},
{"name":"骨肉分离，孤独悲愁，难得心安，做事不成。","xj":"凶","value":"非命"},
{"name":"天长地久，家运隆昌，福寿绵长，事事成就。","xj":"大吉","value":"巨流归海"},
{"name":"进退维谷，艰难不堪，等待时机，一跃而起。","xj":"凶","value":"岩头步马"},
{"name":"天赋幸运，四通八达，家道繁昌，富贵东来。","xj":"大吉","value":"顺风通达"},
{"name":"智虑周密，集众信达，发明能智，拓展昂进。","xj":"大吉","value":"顺风吹帆"},
{"name":"非业非力，精神迫滞，灾害交至，遍偿痛苦。","xj":"凶","value":"非业"},
{"name":"残菊逢霜，寂寞无碍，惨淡忧愁，晚景凄凉。","xj":"凶","value":"残菊逢霜"},
{"name":"石上金花，内心劳苦，贯彻始终，定可昌隆。","xj":"半吉","value":"石上金花"},
{"name":"荣苦相伴，阴云覆月，外表吉祥，内实凶祸。","xj":"凶","value":"劳苦"},
{"name":"盛衰交加，徒有高志，天王福祉，终世平安。","xj":"半吉","value":"无勇"},
{"name":"残菊经霜，秋叶寂寞，无能无智，辛苦繁多。","xj":"凶","value":"残菊经霜"},
{"name":"退守保吉，发迹甚迟，虽有吉象，无谋难成。","xj":"半吉","value":"退守"},
{"name":"倾覆离散，骨肉分离，内外不和，虽劳无功。","xj":"凶","value":"离散"},
{"name":"家庭有悦，半吉半凶，能获援护，陷落不幸。","xj":"半吉","value":"半吉"},
{"name":"祸福参半，先天智能，中年发达，晚景困苦。","xj":"凶","value":"晚苦"},
{"name":"云头望月，身疲力尽，穷迫不伸，精神不定。","xj":"凶","value":"云头望月"},
{"name":"辛苦不绝，早入隐遁，安心立命，化凶转吉。","xj":"凶","value":"遁吉"},
{"name":"最吉之数，还本归元，吉祥重叠，富贵尊荣。","xj":"大吉","value":"万物回春"},
    ]

  },

  onLoad: function() {
     

 
  },

  onGetUserInfo: function(e) {
 
  },

  onGetOpenid: function() {
     
  },
  bindKeyInput:function(e){
  console.log(e)
    if(e.detail.value.length<11){
      this.setData({
        discribe:"您已输入" + e.detail.value.length + "位，请输入11位手机号测吉凶"
,
        phoneNumber:"",
        NumberAnalys:"",
        slpf:""  ,
        shuliDiscribe:"",
        textfx:"" ,
        hmfx:"",
        xjxj: ""
      })
    }else{

      var number = e.detail.value;
       //取后四位
       var last4 = (number).substr(-4)  
       //计算数理方法
       var n1 = last4/80
       var n2 = parseInt(last4/80)
       var baseNum = parseInt(Math.round((n1-n2)*80))
       console.log(baseNum)
       if(baseNum == 0 ) {
         baseNum = 1
       }
       if(baseNum > 81){
        baseNum = baseNum -80
      }
      console.log(baseNum)
       var ana = this.data.text[baseNum]
       var xjxj = ana.substr(19)
       if(xjxj == '吉'){
         this.setData({
           type:1
         })
       }else{
         this.setData({
           type:2
         })
       }
      var sl = this.data.shuliText[parseInt(baseNum)-1]
     
      this.setData({
        discribe:"",
        phoneNumber:"手机号码：" + e.detail.value,
        NumberAnalys:"数理评分：",
        slpf:sl.value + " , " + sl.xj ,
        shuliDiscribe:"该号码数理为" + baseNum + "," + sl.name,
        textfx:ana.substr(0,19) ,
        hmfx:"号码分析：",
        xjxj:ana.substr(19)
      })
     
    }
  }
     

})
